Object Def Format


The "Object Def" file is used to create "Game Objects" by assigning them Sprite art, Animations, controller Functions, and other properties.

The two basic types of Functions are Built-in, and Scripted. Each functional aspect of an Object may contain both a Built-in and a Scripted Function, with the Scripted Function being called after the Built-in one is completed. To omit a Built-in Function, use the "0" Function ID, which points to a blank Function. To omit a Scripted Function, use the ID "65535", which will (presumeably) always be an "invalid" Function ID, causing it to be ignored.

In some places, the flags "G", "Z", and "A" can be used to access data that was loaded as "Game", "Zone", or "Act" data. "Act" data may only be used when the file is being referenced for a "Zone" or "Act" by a "Zone Def" file, because unless a new "Zone" has begun to load, the program cannot calculate the real ID of the requested "Act" data. Data in any list receives an ID number according to the order in which it was loaded, plus the number of data loaded for previous sectons ("Game"/"Zone")

Format Description

  • Number of total Movement Funcs


  • Number of Movement Func Files


  • Number of total Drawing Funcs


  • Number of Drawing Func Files


  • Number of total Collision Funcs


  • Number of Collision Func Files


  • Number of total Projectile Collision Funcs


  • Number of Projectile Collision Func Files


  • Number of total Animation Funcs


  • Number of Animation Func Files


  • Number of total Debug Placement Funcs


  • Number of Debug Placement Func Files


  • Number of total Debug Drawing Funcs


  • Number of Debug Drawing Func Files


  • Number of Objects


  • Num Linked Objects


  • Num Constant Lists



    Example Object Def

    ;;;;;;;;;;;;;;;;;;;;;;
    ; Example Object Def ;
    ;;;;;;;;;;;;;;;;;;;;;;
    
    Sprite File:  art/global.spr
    
    Number of total Movement Funcs:    3
    Number of Movement Func Files:     1
              Movement Func File 0:   objmv.def
                                     ;0-  Scripted Movement Function 0
                                     ;1-  Scripted Movement Function 1
                                     ;2-  Scripted Movement Function 2
    
    Number of total Projectile Collision Funcs:   0
    Number of Projectile Collision Func Files:    0
    
    
    Number of total Animation Funcs:    2
    Number of Animation Func Files:     1
              Animation Func File 0:    objani.def
                                       ;0- Scripted Animation Function 0
                                       ;1- Scripted Animation Function 1
    
    Number of total Debug Placement Funcs:   1
    Number of Debug Placement Func Files:    1
              Debug Placement Func File 0:   objdp.def
                                            ;0- Scripted Debug Placement Function 0
    
    Number of total Debug Drawing Funcs:   1
    Number of Debug Drawing Func Files:    1
              Debug Drawing Func File 0:   objdd.def
                                          ;0- Scripted Debug Drawing Function 0
    
    
    Number of Objects:  5
    
    ;;;;;;;;;;;
    ;If this Object Def were loaded as "Game-global" by a "Game Def", Entry 0 should be regarded as "invalid", and have no useful settings
    ;If this Object Def were loaded as "Zone-specific" by a "Zone Def", Entry 0 may contain a valid, useable Object Type entry
    ;;;;;;;;;;;
    
    Obj  0- Blank Object
            Drawing Priority:     0
             Extra Variables:     0
          Out Of Range Event: _Range_Freeze
                       Flags:     0
           Movement Function: _OMove_None
     Scrpt Movement Function: _Func_None
            Drawing Function: _ODraw_None
     Script Drawing Function: _Func_None
            Collide Function: _OCol_None
     Script Collide Function: _Func_None
           PCollide Function: _OPCol_None
     Scrpt PCollide Function: _Func_None
            Debug P Function: _ODebugP_None
     Script Debug P Function: _Func_None
            Debug D Function: _ODebugD_None
     Script Debug D Function: _Func_None
     Spawn Values-      None
             Num Sprite Sets:     0
              Num Animations:     0
                  Num Sounds:     0
          Num Linked Objects:     0
          Num Constant Lists:     0
    
    Obj  1- Collectable Item Object, Saves
            Drawing Priority:    30
             Extra Variables:     0
          Out Of Range Event: _Range_Freeze
                       Flags:     S
           Movement Function: _OMove_Animate
     Scrpt Movement Function: _Func_None
            Drawing Function: _ODraw_Animated
     Script Drawing Function: _Func_None
            Collide Function: _OCol_Item
     Script Collide Function: _Func_None
           PCollide Function: _OPCol_None
     Scrpt PCollide Function: _Func_None
            Debug P Function: _ODebugP_Standard
     Script Debug P Function: _Func_None
            Debug D Function: _ODebugD_FirstFrame
     Script Debug D Function: _Func_None
     Spawn Values-      None
             Num Sprite Sets:     1
     Sprite 0-        Set ID:    G1 ;Game Sprite Set 1
              Num Animations:     1
     Ani 0-     Animation ID:    G0 ;Game Animation 0
                  Num Sounds:     1
     Sound 0-       Sound ID:    G4 ;Game Sound Effect 4 (plays when the item is picked up
          Num Linked Objects:     1
     Object 0-     Object ID:    G2 ;Game Object 2 (spawns when the item is picked up)
          Num Constant Lists:     1
     List 0-   Num Constants:     3
                  Constant 0:    a8 ;User-created "Active Variable" 8
                  Constant 1:     1 ;Item increases variable by 1
                  Constant 2:   999 ;Variable should not excede 999
    
    Obj  2- Path-Mobile Script-Driven Object That Has Custom Collision With the Player, Spawned By Another Object, Not By "Debug", Doesn't Save
            Drawing Priority:    30
             Extra Variables:    14
          Out Of Range Event: _Range_Freeze
                       Flags:     0
           Movement Function: _OMove_Floor_Normal
     Scrpt Movement Function:    G0 ;Game Scripted Object Movement Function 0
            Drawing Function: _ODraw_Animated_Directional
     Script Drawing Function: _Func_None
            Collide Function: _OCol_None
     Script Collide Function:    G0 ;Game Scripted Object Collision Function 0
           PCollide Function: _OPCol_None
     Scrpt PCollide Function: _Func_None
            Debug P Function: _ODebugP_None
     Script Debug P Function: _Func_None
            Debug D Function: _ODebugD_None
     Script Debug D Function: _Func_None
     Spawn Values-   Value 0:    *0 -Reserved 1     ;Obtain initial value from spawn parameter 0
                     Value 1:    *1 -Reserved 2     ;Obtain initial value from spawn parameter 1
                     Value 2:     0 -XVel
                     Value 3:     0 -YVel
                     Value 4:     0 -XCount
                     Value 5:     0 -YCount
                     Value 6:     0 -XAccel
                     Value 7:     0 -YAccel
                     Value 8:   R12 -Layer		;Obtain initial value from User Register 12 when spawned
                     Value 9:     0 -EdgePause
                    Value 10:     4 -SlopeTolerance
                    Value 11:     8 -DropTolerance
                    Value 12:     8 -RiseTolerance
             Num Sprite Sets:     1
     Sprite 0-        Set ID:    G2 ;Game Sprite Set 2
              Num Animations:     2
     Ani 0-     Animation ID:    G1 ;Game Animation 1
     Ani 1-     Animation ID:    G1 ;Game Animation 2
                  Num Sounds:     0
          Num Linked Objects:     0
          Num Constant Lists:     0
    
    Obj  3- Vertical PlaneSwitch Left to Plane 2, Right to Plane 3, Player must be on path for change to take effect, Saves
            Drawing Priority:    30
             Extra Variables:     0
          Out Of Range Event: _Range_Freeze
                       Flags:     S
           Movement Function: _OMove_None
     Scrpt Movement Function: _Func_None
            Drawing Function: _ODraw_PlaneSwitchV
     Script Drawing Function: _Func_None
            Collide Function: _OCol_PlaneSwitchV
     Script Collide Function: _Func_None
           PCollide Function: _OPCol_None
     Scrpt PCollide Function: _Func_None
            Debug P Function: _ODebugP_Standard
     Script Debug P Function: _Func_None
            Debug D Function: _ODebugD_PlaneSwitchV
     Script Debug D Function: _Func_None
     Spawn Values-      None
             Num Sprite Sets:     1
     Sprite 0-        Set ID:    G1 ;Game Sprites Set 1
              Num Animations:     0
                  Num Sounds:     0
          Num Linked Objects:     0
          Num Constant Lists:     1
     List 0-   Num Constants:     3
                  Constant 0:     3 ;Plane ID ->
                  Constant 1:     2 ;Plane ID <-
                  Constant 2:     0 ;Must be on path
    
    Obj  4- 4x4 Tiled Path Object That Moves Through Freespace (No Level Collision), Doesn't Save, Destroyed When out of "Activity Range"
            Drawing Priority:    90
             Extra Variables:    15
          Out Of Range Event: _Range_Destroy
                       Flags:     0
           Movement Function: _OMove_Normal
     Scrpt Movement Function: _Func_None
            Drawing Function: _ODraw_Tiled
     Script Drawing Function: _Func_None
            Collide Function: _OCol_Tiled
     Script Collide Function: _Func_None
           PCollide Function: _OPCol_None
     Scrpt PCollide Function: _Func_None
            Debug P Function: _ODebugP_Standard
     Script Debug P Function: _Func_None
            Debug D Function: _ODebugD_Tiled
     Script Debug D Function: _Func_None
     Spawn Values-   Value 0:     8 -Plat Start      ;Tile Map Data starts at "Extra Variable" 8
                     Value 1:     0 -Reserved 2
                     Value 2:     0 -X Vel           ;"Extra Variables" 2-7 are being used by standard freespace movement
                     Value 3:     0 -Y Vel
                     Value 4:     0 -X Count
                     Value 5:     0 -Y Count
                     Value 6:     0 -X Accel
                     Value 7:   $32 -Y Accel
                       Width:     2 -Width           ;Tile Map Data, begins with Height, Width, and Plane ID properties, then Map Layout Data
                      Height:     2 -Height
                       Plane:     0 -Plane
                  TileID   0:    12 -Tile ID  0, 0
                  TileID   1:    13 -Tile ID  1, 0
                  TileID   2:    14 -Tile ID  0, 1
                  TileID   3:    15 -Tile ID  1, 1
             Num Sprite Sets:     0
              Num Animations:     0
                  Num Sounds:     0
          Num Linked Objects:     0
          Num Constant Lists:     0